/*
 * @file callbacks.h
 * @author Vincent Wei
 * @date 2022/01/29
 * @brief The general callback prototypes.
 *
 * This file is a part of PurC (short for Purring Cat), an HVML interpreter.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PURC_PRIVATE_CALLBACKS_H
#define PURC_PRIVATE_CALLBACKS_H

#include <stdint.h>

/** The callback function prototype for copying a datum. */
typedef void *(*pcutils_copy_fn)(const void *datum);

/** The callback function prototype for freeing a datum. */
typedef void (*pcutils_free_fn)(void *datum);

/** The callback function prototype for calculating hash value of a datum. */
typedef uint32_t (*pcutils_hash_fn)(const void *datum);

/** The callback function prototype for comparing two datums. */
typedef int (*pcutils_comp_fn)(const void *d1, const void *d2);

/** The callback function prototype for freeing a pair of key and value. */
typedef void (*pcutils_free_kv_fn)(void *key, void *val);

#endif /* PURC_PRIVATE_CALLBACKS_H */

